package com.tmptSource.controller.action;

import com.opensymphony.xwork2.ActionSupport;
import com.tmpt.dto.Result;
import com.tmpt.utils.report.ExcelUtils;
import com.tmptSource.dto.A2userDto;
import com.tmptSource.dto.OwPictureMagDto;
import com.tmptSource.dto.OwTaskDto;
import com.tmptSource.dto.PageDto;
import com.tmptSource.service.intf.IOwTaskService;
import com.tmpt.utils.*;
import lombok.Getter;
import lombok.Setter;
import net.sf.json.JSONArray;
import net.sf.json.JSONObject;
import org.apache.log4j.Logger;
import org.apache.struts2.ServletActionContext;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Controller;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import java.math.BigDecimal;
import java.util.*;

@Getter
@Setter
@Controller(value="owTaskAction")
@Scope("prototype")
public class OwTaskAction extends ActionSupport {
	private Logger log = Logger.getLogger(this.getClass());


	//------------
	//与页面交互的分页和排序
	//--------------
	private int page=0;
	private int rows=0;
	private String sortColumn;
	private String sortOrder;

	//------------
	//与页面交互的业务数据
	//--------------
    private String id;
    private String registerDataNumber;
    private String taskNumber;
    private String deleteflag;
    private String name;
    private String createdate;
	private String createdate_Start;
	private String createdate_End;
    private String owPriorityCode;
    private String createman;
    private String owTaskType;
    private String modifydate;
	private String modifydate_Start;
	private String modifydate_End;
    private String owRegisterType;
    private String modifyman;
    private String owViolationType;
    private String createmanId;
    private String finderDeptId;
    private String modifymanId;
    private String finderDeptName;
    private String companyId;
    private String baseCommiteeId;
    private String baseRoadId;
    private String posHouseNumber;
    private String posDesc;
    private String posLng;
    private String posLat;
    private String litigantName;
    private String litigantPhone;
    private String mainManId;
    private String assistManId;
    private String mainManName;
    private String issueContent;
    private String assistManName;
    private String remark;
    private String improveRequied;
    private String dealIssueContent;
    private String owDealType;
    private String dealTime;
	private String dealTime_Start;
	private String dealTime_End;
    private String dealResult;
    private String dealRemark;
    private String owPictureMagDtoListStr;
    private String wfTaskId;
    private String owIssueDeclareId;
    private String owTaskStatus;
	private String a2userId;

	//返回结果
	private String result;
	//返回结果
	private List<Map<String,Object>> jsonArrayResult = new ArrayList<Map<String,Object>>();


	@Resource
	private IOwTaskService owTaskService;


	/**
	* 分页查询列表
	* @return
	*/
	public String queryListBySearch(){
		try {

			HttpServletResponse response = ServletActionContext.getResponse();
			HttpServletRequest request = WebUtils.getRequest();
			HttpSession session = request.getSession();

			//查询参数
			//分页/排序查询条件
			PageDto pageDto = new PageDto();
			//默认主键desc
			if(StringUtils.isNull(sortColumn)){
				sortColumn = "id";
				sortOrder = "desc";
			}
			pageDto.setPageCurrent(page-1);
			pageDto.setPageSize(rows);
			pageDto.setSortColumn(sortColumn);
			pageDto.setSortOrder(sortOrder);

			//查询条件
			OwTaskDto owTaskParam = new OwTaskDto();
			owTaskParam.setName(this.name!=null?"%"+this.name+"%":null);
			owTaskParam.setCreatedate_Start(this.createdate_Start);
			owTaskParam.setCreatedate_End(this.createdate_End);
			owTaskParam.setDealTime_Start(this.dealTime_Start);
			owTaskParam.setDealTime_End(this.dealTime_End);
			owTaskParam.setCreatedate(this.createdate);
			owTaskParam.setOwTaskStatus(this.owTaskStatus);
			owTaskParam.setRegisterDataNumber(this.registerDataNumber);
			owTaskParam.setAssistManId(this.a2userId);

			//data limit control
			String requireUrl = request.getRequestURI().toString();
			String queryString = request.getQueryString();
			String contextPath = request.getContextPath();
			//data limit parameters
			String userId = WebUtils.getUserId();
			Map<String,Object> paramMap = new HashMap<String, Object>();
			paramMap.put("userId", userId);
			paramMap.put("contextPath", contextPath);
			paramMap.put("requireUrl", requireUrl);
			paramMap.put("queryString", queryString);

			//调用远程服务
			Result<OwTaskDto> resultObj =  owTaskService.pagination(owTaskParam,pageDto,paramMap);
			if(!resultObj.isSuccess()){
				this.result = "error:"+resultObj.getContent();
				JsonPaginationUtils.responseWriter(response, this.result);
				return "jsonResult";
			}
			Map<String,Object> resultMap = resultObj.getResultMap();

			//分页记录
			List<OwTaskDto> list = (List<OwTaskDto>)resultMap.get("rows");
			JSONArray jsonArrayRows = JSONArray.fromObject(list);

			//分页总记录数
			int total = 0;
			if(resultMap.get("total") != null){
				total = Integer.parseInt(resultMap.get("total").toString());
			}

			//分页合计（select '合计' as c1, sum(balance) as c2 ....）
			JSONArray jsonArrayFooter = null;
			if(resultMap.get("footer")!=null){
				jsonArrayFooter = JSONArray.fromObject(resultMap.get("footer"));
			}

			JSONObject json = new JSONObject();
			json.put("total", total);
			json.put("rows", jsonArrayRows);
			//json.put("reportSqlString",reportSqlString);
			if(jsonArrayFooter!=null){
				json.put("footer", jsonArrayFooter);
			}

			this.result = json.toString();
			JsonPaginationUtils.responseWriter(response, this.result);

		} catch (Exception e) {
			e.printStackTrace();
		}
		return "jsonResult";
	}



	/**
	 * 分页查询列表(没有数据边界)
	 * @return
	 */
	public String download(){
		try {
			page=1;
			rows=1000000;

			HttpServletResponse response = ServletActionContext.getResponse();
			HttpServletRequest request = WebUtils.getRequest();
			HttpSession session = request.getSession();

			//查询参数
			//分页/排序查询条件
			PageDto pageDto = new PageDto();
			//默认主键desc
			if(StringUtils.isNull(sortColumn)){
				sortColumn = "id";
				sortOrder = "desc";
			}
			pageDto.setPageCurrent(page-1);
			pageDto.setPageSize(rows);
			pageDto.setSortColumn(sortColumn);
			pageDto.setSortOrder(sortOrder);

			//查询条件
			OwTaskDto owTaskParam = new OwTaskDto();
			owTaskParam.setName(this.name!=null?"%"+this.name+"%":null);
			owTaskParam.setCreatedate_Start(this.createdate_Start);
			owTaskParam.setCreatedate_End(this.createdate_End);
			owTaskParam.setDealTime_Start(this.dealTime_Start);
			owTaskParam.setDealTime_End(this.dealTime_End);
			owTaskParam.setCreatedate(this.createdate);
			owTaskParam.setOwTaskStatus(this.owTaskStatus);
			owTaskParam.setRegisterDataNumber(this.registerDataNumber);
			owTaskParam.setAssistManId(this.a2userId);

			//调用远程服务
			Result<OwTaskDto> resultObj =  owTaskService.pagination(owTaskParam,pageDto);
			if(!resultObj.isSuccess()){
				this.result = "error:"+resultObj.getContent();
				JsonPaginationUtils.responseWriter(response, this.result);
				return "jsonResult";
			}
			Map<String,Object> resultMap = resultObj.getResultMap();

			//分页记录
			List<OwTaskDto> list = (List<OwTaskDto>)resultMap.get("rows");
			JSONArray jsonArrayRows = JSONArray.fromObject(list);

			//分页总记录数
			int total = 0;
			if(resultMap.get("total") != null){
				total = Integer.parseInt(resultMap.get("total").toString());
			}

			//分页合计（select '合计' as c1, sum(balance) as c2 ....）
			JSONArray jsonArrayFooter = null;
			List<OwTaskDto> listFooter = null;
			if(resultMap.get("footer")!=null){
				listFooter = (List<OwTaskDto>)resultMap.get("footer");
				jsonArrayFooter = JSONArray.fromObject(listFooter);
			}

			JSONObject json = new JSONObject();
			json.put("total", total);
			json.put("rows", jsonArrayRows);
			//json.put("reportSqlString",reportSqlString);
			if(jsonArrayFooter!=null){
				json.put("footer", jsonArrayFooter);
			}

			//this.result = json.toString();
			//JsonPaginationUtils.responseWriter(response, this.result);

			//报表
			List<List<String>> rowList = new ArrayList<List<String>>();
			List<String> col = null;

			col = new ArrayList<String>();
			col.add("标题");
			col.add("登记编号");
			col.add("任务编号");
			col.add("紧急程度");
			col.add("任务状态");
			col.add("任务类型");
			col.add("登记类型");
			col.add("违规类型");
			col.add("所属居委");
			col.add("地址");
			col.add("当事人");
			col.add("当事人电话");
			col.add("主办人姓名");
			col.add("协办人姓名");
			col.add("备注");
			col.add("整改要求");
			col.add("处理时现场情况");
			col.add("处理方式");
			col.add("完成时间");
			col.add("处理结果");
			col.add("解决备注");
			col.add("创建人");
			col.add("创建日期");
			rowList.add(col);

			for(OwTaskDto itemDto : list){
				col = new ArrayList<String>();
				col.add(itemDto.getName());
				col.add(itemDto.getRegisterDataNumber());
				col.add(itemDto.getTaskNumber());
				col.add(itemDto.getOwPriorityCode_Str());
				col.add(itemDto.getOwTaskStatus_Str());
				col.add(itemDto.getOwTaskType_Str());
				col.add(itemDto.getOwRegisterType_Str());
				col.add(itemDto.getOwViolationType_Str());
				col.add(itemDto.getBaseCommiteeName());
				col.add(itemDto.getPosDesc());
				col.add(itemDto.getLitigantName());
				col.add(itemDto.getLitigantPhone());
				col.add(itemDto.getMainManName());
				col.add(itemDto.getAssistManName());
				col.add(itemDto.getRemark());
				col.add(itemDto.getImproveRequied());
				col.add(itemDto.getDealIssueContent());
				col.add(itemDto.getOwDealType_Str());
				col.add(itemDto.getDealTime());
				col.add(itemDto.getDealResult());
				col.add(itemDto.getDealRemark());
				col.add(itemDto.getCreateman());
				col.add(itemDto.getCreatedate());
				rowList.add(col);
			}

			ExcelUtils.downloadReport("任务列表", rowList, response);

		} catch (Exception e) {
			e.printStackTrace();
		}
		return "jsonResult";
	}




	/**
	* 伪删除数据
	* @return
	*/
	public String removeData(){
		Result resultObj = new Result();
		try {
			HttpServletResponse response = ServletActionContext.getResponse();
			HttpServletRequest request = WebUtils.getRequest();
			HttpSession session = request.getSession();

			//参数
			String adminMan = WebUtils.getUsername();//加入管理员

			//调用远程服务
			resultObj =  owTaskService.deleteById(Long.valueOf(id),adminMan);
			if(!resultObj.isSuccess()){
				this.result = "error:"+resultObj.getContent();
				JsonPaginationUtils.responseWriter(response, this.result);
				return "jsonResult";
			}
			this.jsonArrayResult.add(resultObj.getResultMap());

		} catch (Exception e) {
			e.printStackTrace();
			resultObj.fault("error:系统出错:"+e.getLocalizedMessage());
			this.jsonArrayResult.add(resultObj.getResultMap());
		}

		return "jsonArray";
	}


	/**
	* 编辑数据
	* @return
	*/
	public String editData(){
		Result<OwTaskDto> resultObj = new Result();
		try {
			HttpServletResponse response = ServletActionContext.getResponse();
			HttpServletRequest request = WebUtils.getRequest();
			HttpSession session = request.getSession();

			//参数
			OwTaskDto owTaskDto = new OwTaskDto();
			String adminMan = WebUtils.getUsername();//加入管理员
            String userId = WebUtils.getUserId();
			owTaskDto.setModifymanId(userId);
			owTaskDto.setModifyman(adminMan);
			owTaskDto.setCompanyId(WebUtils.getCompanyId());
			owTaskDto.setId(this.id);
			//编辑数据
			owTaskDto.setRegisterDataNumber(this.registerDataNumber);
			owTaskDto.setTaskNumber(this.taskNumber);
			owTaskDto.setName(this.name);
			owTaskDto.setOwPriorityCode(this.owPriorityCode);
			owTaskDto.setOwTaskType(this.owTaskType);
			owTaskDto.setOwRegisterType(this.owRegisterType);
			owTaskDto.setOwViolationType(this.owViolationType);
			owTaskDto.setFinderDeptId(this.finderDeptId);
			owTaskDto.setFinderDeptName(this.finderDeptName);
			owTaskDto.setBaseCommiteeId(this.baseCommiteeId);
			owTaskDto.setBaseRoadId(this.baseRoadId);
			owTaskDto.setPosHouseNumber(this.posHouseNumber);
			owTaskDto.setPosDesc(this.posDesc);
			owTaskDto.setPosLng(this.posLng);
			owTaskDto.setPosLat(this.posLat);
			owTaskDto.setLitigantName(this.litigantName);
			owTaskDto.setLitigantPhone(this.litigantPhone);
			owTaskDto.setMainManId(this.mainManId);
			owTaskDto.setAssistManId(this.assistManId);
			owTaskDto.setIssueContent(this.issueContent);
			owTaskDto.setRemark(this.remark);
			owTaskDto.setImproveRequied(this.improveRequied);
			owTaskDto.setDealIssueContent(this.dealIssueContent);
			owTaskDto.setOwDealType(this.owDealType);
			owTaskDto.setDealTime(this.dealTime);
			owTaskDto.setDealResult(this.dealResult);
			owTaskDto.setDealRemark(this.dealRemark);

			//调用远程服务
			resultObj =  owTaskService.editData(owTaskDto);
			if(!resultObj.isSuccess()){
				this.result = "error:"+resultObj.getContent();
				JsonPaginationUtils.responseWriter(response, this.result);
				return "jsonResult";
			}
			this.jsonArrayResult.add(resultObj.getResultMap());

		} catch (Exception e) {
			e.printStackTrace();
			resultObj.fault("error:系统出错:"+e.getLocalizedMessage());
			this.jsonArrayResult.add(resultObj.getResultMap());
		}

		return "jsonArray";
	}

	/**
	* 工作流：审核->编辑数据
	* @return
	*/
	public String wfEditData(){
		Result<OwTaskDto> resultObj = new Result();
		try {
			HttpServletResponse response = ServletActionContext.getResponse();
			HttpServletRequest request = WebUtils.getRequest();
			HttpSession session = request.getSession();

			//参数
			OwTaskDto owTaskDto = new OwTaskDto();
			String adminMan = WebUtils.getUsername();//加入管理员
            String userId = WebUtils.getUserId();
			owTaskDto.setModifymanId(userId);
			owTaskDto.setModifyman(adminMan);
			owTaskDto.setCompanyId(WebUtils.getCompanyId());
			owTaskDto.setId(this.id);
			//编辑数据
			owTaskDto.setRegisterDataNumber(this.registerDataNumber);
			owTaskDto.setTaskNumber(this.taskNumber);
			owTaskDto.setName(this.name);
			owTaskDto.setOwPriorityCode(this.owPriorityCode);
			owTaskDto.setOwTaskType(this.owTaskType);
			owTaskDto.setOwRegisterType(this.owRegisterType);
			owTaskDto.setOwViolationType(this.owViolationType);
			owTaskDto.setFinderDeptId(this.finderDeptId);
			owTaskDto.setFinderDeptName(this.finderDeptName);
			owTaskDto.setBaseCommiteeId(this.baseCommiteeId);
			owTaskDto.setBaseRoadId(this.baseRoadId);
			owTaskDto.setPosHouseNumber(this.posHouseNumber);
			owTaskDto.setPosDesc(this.posDesc);
			owTaskDto.setPosLng(this.posLng);
			owTaskDto.setPosLat(this.posLat);
			owTaskDto.setLitigantName(this.litigantName);
			owTaskDto.setLitigantPhone(this.litigantPhone);
			owTaskDto.setMainManId(this.mainManId);
			owTaskDto.setAssistManId(this.assistManId);
			owTaskDto.setIssueContent(this.issueContent);
			owTaskDto.setRemark(this.remark);
			owTaskDto.setImproveRequied(this.improveRequied);
			owTaskDto.setDealIssueContent(this.dealIssueContent);
			owTaskDto.setOwDealType(this.owDealType);
			owTaskDto.setDealTime(this.dealTime);
			owTaskDto.setDealResult(this.dealResult);
			owTaskDto.setDealRemark(this.dealRemark);

			//调用远程服务
			resultObj =  owTaskService.editData(owTaskDto);
			if(!resultObj.isSuccess()){
				this.result = "error:"+resultObj.getContent();
				JsonPaginationUtils.responseWriter(response, this.result);
				return "jsonResult";
			}

			System.out.println("====>wfTaskId:" + wfTaskId);
			//完成我的任务
			owTaskDto.setWfTaskId(wfTaskId);
			Map<String,Object> paramMap = new HashMap<String, Object>();
			paramMap.put("userId", userId);
			//paramMap.put("taskId", wfTaskId);
			//owTaskService.completeMyTaskWF(paramMap);
			owTaskService.dealMyTaskWF(owTaskDto,paramMap);

			this.jsonArrayResult.add(resultObj.getResultMap());

		} catch (Exception e) {
			e.printStackTrace();
			resultObj.fault("error:系统出错:"+e.getLocalizedMessage());
			this.jsonArrayResult.add(resultObj.getResultMap());
		}

		return "jsonArray";
	}

	/**
	* 添加数据
	* @return
	*/
	public String addData(){
		Result<OwTaskDto> resultObj = new Result();
		try {
			HttpServletResponse response = ServletActionContext.getResponse();
			HttpServletRequest request = WebUtils.getRequest();
			HttpSession session = request.getSession();

			//插入参数
			OwTaskDto owTaskDto = new OwTaskDto();
			String adminMan = WebUtils.getUsername();//加入管理员
			String userId = WebUtils.getUserId();
			owTaskDto.setCreatemanId(userId);
			owTaskDto.setCreateman(adminMan);
			owTaskDto.setCompanyId(WebUtils.getCompanyId());
			//插入数据
			owTaskDto.setRegisterDataNumber(this.registerDataNumber);
			owTaskDto.setTaskNumber(this.taskNumber);
			owTaskDto.setName(this.name);
			owTaskDto.setOwPriorityCode(this.owPriorityCode);
			owTaskDto.setOwTaskType(this.owTaskType);
			owTaskDto.setOwRegisterType(this.owRegisterType);
			owTaskDto.setOwViolationType(this.owViolationType);
			owTaskDto.setFinderDeptId(this.finderDeptId);
			owTaskDto.setFinderDeptName(this.finderDeptName);
			owTaskDto.setBaseCommiteeId(this.baseCommiteeId);
			owTaskDto.setBaseRoadId(this.baseRoadId);
			owTaskDto.setPosHouseNumber(this.posHouseNumber);
			owTaskDto.setPosDesc(this.posDesc);
			owTaskDto.setPosLng(this.posLng);
			owTaskDto.setPosLat(this.posLat);
			owTaskDto.setLitigantName(this.litigantName);
			owTaskDto.setLitigantPhone(this.litigantPhone);
			owTaskDto.setMainManId(this.mainManId);
			owTaskDto.setAssistManId(this.assistManId);
			owTaskDto.setIssueContent(this.issueContent);
			owTaskDto.setRemark(this.remark);
			owTaskDto.setImproveRequied(this.improveRequied);
			owTaskDto.setDealIssueContent(this.dealIssueContent);
			owTaskDto.setOwDealType(this.owDealType);
			owTaskDto.setDealTime(this.dealTime);
			owTaskDto.setDealResult(this.dealResult);
			owTaskDto.setDealRemark(this.dealRemark);

			//添加图片
			String[] owPictureMagDtoArr = this.getOwPictureMagDtoListStr().split(";");
			for(int i=0;i<owPictureMagDtoArr.length;i++){
				String imgPath = owPictureMagDtoArr[i];
				OwPictureMagDto owPictureMagDto = new OwPictureMagDto();
				owPictureMagDto.setPath(imgPath);
				owTaskDto.getOwPictureMagDtoList().add(owPictureMagDto);
			}

			//调用远程服务
			resultObj =  owTaskService.addData(owTaskDto);
			if(!resultObj.isSuccess()){
				this.result = "error:"+resultObj.getContent();
				JsonPaginationUtils.responseWriter(response, this.result);
				return "jsonResult";
			}
			this.jsonArrayResult.add(resultObj.getResultMap());

		} catch (Exception e) {
			e.printStackTrace();
			resultObj.fault("error:系统出错:"+e.getLocalizedMessage());
			this.jsonArrayResult.add(resultObj.getResultMap());
		}
		return "jsonArray";
	}

	/**
	* 添加数据:地图管理中生成任务
	* @return
	*/
	public String addData4genTask(){
		Result<OwTaskDto> resultObj = new Result();
		try {
			HttpServletResponse response = ServletActionContext.getResponse();
			HttpServletRequest request = WebUtils.getRequest();
			HttpSession session = request.getSession();

			//插入参数
			OwTaskDto owTaskDto = new OwTaskDto();
			String adminMan = WebUtils.getUsername();//加入管理员
			String userId = WebUtils.getUserId();
			owTaskDto.setCreatemanId(userId);
			owTaskDto.setCreateman(adminMan);
			owTaskDto.setCompanyId(WebUtils.getCompanyId());
			//插入数据
			owTaskDto.setRegisterDataNumber(this.registerDataNumber);
			owTaskDto.setTaskNumber(this.taskNumber);
			owTaskDto.setName(this.name);
			owTaskDto.setOwPriorityCode(this.owPriorityCode);
			owTaskDto.setOwTaskType(this.owTaskType);
			owTaskDto.setOwRegisterType(this.owRegisterType);
			owTaskDto.setOwViolationType(this.owViolationType);
			owTaskDto.setFinderDeptId(this.finderDeptId);
			owTaskDto.setFinderDeptName(this.finderDeptName);
			owTaskDto.setBaseCommiteeId(this.baseCommiteeId);
			owTaskDto.setBaseRoadId(this.baseRoadId);
			owTaskDto.setPosHouseNumber(this.posHouseNumber);
			owTaskDto.setPosDesc(this.posDesc);
			owTaskDto.setPosLng(this.posLng);
			owTaskDto.setPosLat(this.posLat);
			owTaskDto.setLitigantName(this.litigantName);
			owTaskDto.setLitigantPhone(this.litigantPhone);
			owTaskDto.setMainManId(this.mainManId);
			owTaskDto.setAssistManId(this.assistManId);
			owTaskDto.setMainManName(this.mainManName);
			owTaskDto.setAssistManName(this.assistManName);
			owTaskDto.setIssueContent(this.issueContent);
			owTaskDto.setRemark(this.remark);
			owTaskDto.setImproveRequied(this.improveRequied);
			owTaskDto.setDealIssueContent(this.dealIssueContent);
			owTaskDto.setOwDealType(this.owDealType);
			owTaskDto.setDealTime(this.dealTime);
			owTaskDto.setDealResult(this.dealResult);
			owTaskDto.setDealRemark(this.dealRemark);

			//添加图片
			String[] owPictureMagDtoArr = this.getOwPictureMagDtoListStr().split(";");
			for(int i=0;i<owPictureMagDtoArr.length;i++){
				String imgPath = owPictureMagDtoArr[i];
				OwPictureMagDto owPictureMagDto = new OwPictureMagDto();
				owPictureMagDto.setPath(imgPath);
				owTaskDto.getOwPictureMagDtoList().add(owPictureMagDto);
			}


			//check: 主办和协办不能重复同一个人
			if(this.assistManId!=null) {
				List<String> mainManLdList = Arrays.asList(this.mainManId.split(", "));
				List<String> assistManIdList = Arrays.asList(this.assistManId.split(", "));
				for (String assistManIdItem : assistManIdList) {
					if (mainManLdList.contains(assistManIdItem)) {
						resultObj.fault("主办和协办不能重复同一个人");
						this.jsonArrayResult.add(resultObj.getResultMap());
						return "jsonArray";
					}
				}
			}

			//调用远程服务
			Map<String,Object> paramMap = new HashMap<String, Object>();
			paramMap.put("owIssueDeclareId",this.owIssueDeclareId);//待办问题ID,伪删除掉
			resultObj =  owTaskService.addDataAndAssign(owTaskDto,paramMap);
			if(!resultObj.isSuccess()){
				this.result = "error:"+resultObj.getContent();
				JsonPaginationUtils.responseWriter(response, this.result);
				return "jsonResult";
			}
			this.jsonArrayResult.add(resultObj.getResultMap());

		} catch (Exception e) {
			e.printStackTrace();
			resultObj.fault("error:系统出错:"+e.getLocalizedMessage());
			this.jsonArrayResult.add(resultObj.getResultMap());
		}
		//111
		return "jsonArray";
	}


	//=====================================================
	// setter getter method
	//=====================================================
	public String getOwPictureMagDtoListStr(){
		return owPictureMagDtoListStr;
	}
	public void setOwPictureMagDtoListStr(String owPictureMagDtoListStr){
		this.owPictureMagDtoListStr = owPictureMagDtoListStr;
	}
	public String getWfTaskId(){
		return wfTaskId;
	}
	public void setWfTaskId(String wfTaskId){
		this.wfTaskId = wfTaskId;
	}

	public String getOwIssueDeclareId(){
		return owIssueDeclareId;
	}
	public void setOwIssueDeclareId(String owIssueDeclareId){
		this.owIssueDeclareId = owIssueDeclareId;
	}

	public String getId(){
	return id;
	}
	public void setId(String id){
	this.id = id;
	}
	public String getRegisterDataNumber(){
	return registerDataNumber;
	}
	public void setRegisterDataNumber(String registerDataNumber){
	this.registerDataNumber = registerDataNumber;
	}
	public String getTaskNumber(){
	return taskNumber;
	}
	public void setTaskNumber(String taskNumber){
	this.taskNumber = taskNumber;
	}
	public String getDeleteflag(){
	return deleteflag;
	}
	public void setDeleteflag(String deleteflag){
	this.deleteflag = deleteflag;
	}
	public String getName(){
	return name;
	}
	public void setName(String name){
	this.name = name;
	}
	public String getCreatedate(){
	return createdate;
	}
	public void setCreatedate(String createdate){
	this.createdate = createdate;
	}
    public String getCreatedate_Start(){
    	return createdate_Start;
    }
    public void setCreatedate_Start(String createdate_Start){
    	this.createdate_Start = createdate_Start;
    }
    public String getCreatedate_End(){
    	return createdate_End;
    }
    public void setCreatedate_End(String createdate_End){
    	this.createdate_End = createdate_End;
    }
	public String getOwPriorityCode(){
	return owPriorityCode;
	}
	public void setOwPriorityCode(String owPriorityCode){
	this.owPriorityCode = owPriorityCode;
	}
	public String getCreateman(){
	return createman;
	}
	public void setCreateman(String createman){
	this.createman = createman;
	}
	public String getOwTaskType(){
	return owTaskType;
	}
	public void setOwTaskType(String owTaskType){
	this.owTaskType = owTaskType;
	}
	public String getModifydate(){
	return modifydate;
	}
	public void setModifydate(String modifydate){
	this.modifydate = modifydate;
	}
    public String getModifydate_Start(){
    	return modifydate_Start;
    }
    public void setModifydate_Start(String modifydate_Start){
    	this.modifydate_Start = modifydate_Start;
    }
    public String getModifydate_End(){
    	return modifydate_End;
    }
    public void setModifydate_End(String modifydate_End){
    	this.modifydate_End = modifydate_End;
    }
	public String getOwRegisterType(){
	return owRegisterType;
	}
	public void setOwRegisterType(String owRegisterType){
	this.owRegisterType = owRegisterType;
	}
	public String getModifyman(){
	return modifyman;
	}
	public void setModifyman(String modifyman){
	this.modifyman = modifyman;
	}
	public String getOwViolationType(){
	return owViolationType;
	}
	public void setOwViolationType(String owViolationType){
	this.owViolationType = owViolationType;
	}
	public String getCreatemanId(){
	return createmanId;
	}
	public void setCreatemanId(String createmanId){
	this.createmanId = createmanId;
	}
	public String getFinderDeptId(){
	return finderDeptId;
	}
	public void setFinderDeptId(String finderDeptId){
	this.finderDeptId = finderDeptId;
	}
	public String getModifymanId(){
	return modifymanId;
	}
	public void setModifymanId(String modifymanId){
	this.modifymanId = modifymanId;
	}
	public String getFinderDeptName(){
	return finderDeptName;
	}
	public void setFinderDeptName(String finderDeptName){
	this.finderDeptName = finderDeptName;
	}
	public String getCompanyId(){
	return companyId;
	}
	public void setCompanyId(String companyId){
	this.companyId = companyId;
	}
	public String getBaseCommiteeId(){
	return baseCommiteeId;
	}
	public void setBaseCommiteeId(String baseCommiteeId){
	this.baseCommiteeId = baseCommiteeId;
	}
	public String getBaseRoadId(){
	return baseRoadId;
	}
	public void setBaseRoadId(String baseRoadId){
	this.baseRoadId = baseRoadId;
	}
	public String getPosHouseNumber(){
	return posHouseNumber;
	}
	public void setPosHouseNumber(String posHouseNumber){
	this.posHouseNumber = posHouseNumber;
	}
	public String getPosDesc(){
	return posDesc;
	}
	public void setPosDesc(String posDesc){
	this.posDesc = posDesc;
	}
	public String getPosLng(){
	return posLng;
	}
	public void setPosLng(String posLng){
	this.posLng = posLng;
	}
	public String getPosLat(){
	return posLat;
	}
	public void setPosLat(String posLat){
	this.posLat = posLat;
	}
	public String getLitigantName(){
	return litigantName;
	}
	public void setLitigantName(String litigantName){
	this.litigantName = litigantName;
	}
	public String getLitigantPhone(){
	return litigantPhone;
	}
	public void setLitigantPhone(String litigantPhone){
	this.litigantPhone = litigantPhone;
	}
	public String getMainManId(){
	return mainManId;
	}
	public void setMainManId(String mainManId){
	this.mainManId = mainManId;
	}
	public String getAssistManId(){
	return assistManId;
	}
	public void setAssistManId(String assistManId){
	this.assistManId = assistManId;
	}
	public String getMainManName(){
	return mainManName;
	}
	public void setMainManName(String mainManName){
	this.mainManName = mainManName;
	}
	public String getIssueContent(){
	return issueContent;
	}
	public void setIssueContent(String issueContent){
	this.issueContent = issueContent;
	}
	public String getAssistManName(){
	return assistManName;
	}
	public void setAssistManName(String assistManName){
	this.assistManName = assistManName;
	}
	public String getRemark(){
	return remark;
	}
	public void setRemark(String remark){
	this.remark = remark;
	}
	public String getImproveRequied(){
	return improveRequied;
	}
	public void setImproveRequied(String improveRequied){
	this.improveRequied = improveRequied;
	}
	public String getDealIssueContent(){
	return dealIssueContent;
	}
	public void setDealIssueContent(String dealIssueContent){
	this.dealIssueContent = dealIssueContent;
	}
	public String getOwDealType(){
	return owDealType;
	}
	public void setOwDealType(String owDealType){
	this.owDealType = owDealType;
	}
	public String getDealTime(){
	return dealTime;
	}
	public void setDealTime(String dealTime){
	this.dealTime = dealTime;
	}
    public String getDealTime_Start(){
    	return dealTime_Start;
    }
    public void setDealTime_Start(String dealTime_Start){
    	this.dealTime_Start = dealTime_Start;
    }
    public String getDealTime_End(){
    	return dealTime_End;
    }
    public void setDealTime_End(String dealTime_End){
    	this.dealTime_End = dealTime_End;
    }
	public String getDealResult(){
	return dealResult;
	}
	public void setDealResult(String dealResult){
	this.dealResult = dealResult;
	}

	public String getDealRemark(){
	return dealRemark;
	}
	public void setDealRemark(String dealRemark){
	this.dealRemark = dealRemark;
	}


	public String getOwTaskStatus(){
	return owTaskStatus;
	}
	public void setOwTaskStatus(String owTaskStatus){
	this.owTaskStatus = owTaskStatus;
	}

	public String getSortColumn() {
		return sortColumn;
	}
	public void setSortColumn(String sortColumn) {
		this.sortColumn = sortColumn;
	}
	public String getSortOrder() {
		return sortOrder;
	}
	public void setSortOrder(String sortOrder) {
		this.sortOrder = sortOrder;
	}
	public int getPage() {
		return page;
	}
	public void setPage(int page) {
		this.page = page;
	}
	public int getRows() {
		return rows;
	}
	public void setRows(int rows) {
		this.rows = rows;
	}
	public String getResult() {
		return result;
	}
	public void setResult(String result) {
		this.result = result;
	}
	public List<Map<String, Object>> getJsonArrayResult() {
		return jsonArrayResult;
	}
	public void setJsonArrayResult(List<Map<String, Object>> jsonArrayResult) {
		this.jsonArrayResult = jsonArrayResult;
	}

	public String getA2userId(){
		return a2userId;
	}
	public void setA2userId(String a2userId){
		this.a2userId = a2userId;
	}


}
